package com.pk.platform.business.report.web;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.pk.platform.business.core.web.GenericAction;
import com.pk.platform.business.report.service.IRefundReportService;
import com.pk.platform.business.report.service.ITuitionReportService;
import com.pk.platform.business.report.vo.RefundReportVO;
import com.pk.platform.util.DateConverter;
import com.pk.platform.util.StringConverter;

public class RefundReportAction extends GenericAction {

	private IRefundReportService refundReportService;
	
	private RefundReportVO rrvo = new RefundReportVO();
	
	private List<Map<String, Object>> years = new ArrayList<Map<String,Object>>();
	
	private ITuitionReportService tuitionReportService;
	
	private InputStream excelStream;
	
	public String refundReportManage()
	{
		if(!StringConverter.isNotNull(rrvo.getPeriodStart()))
			rrvo.setPeriodStart(DateConverter.getCurrentYearStr());
		if(!StringConverter.isNotNull(rrvo.getPeriodEnd()))
			rrvo.setPeriodEnd(DateConverter.getCurrentYearStr());
		years = tuitionReportService.getYears();
		return SUCCESS;
	}
	
	public String getRefundReportExcel()
	{
		rrvo.setKindergartenId(kindergartenId);
		excelStream = refundReportService.queryRefundReportList(rrvo);
		return FILE;
	}

	public IRefundReportService getRefundReportService() {
		return refundReportService;
	}

	public void setRefundReportService(IRefundReportService refundReportService) {
		this.refundReportService = refundReportService;
	}

	public RefundReportVO getRrvo() {
		return rrvo;
	}

	public void setRrvo(RefundReportVO rrvo) {
		this.rrvo = rrvo;
	}

	public List<Map<String, Object>> getYears() {
		return years;
	}

	public void setYears(List<Map<String, Object>> years) {
		this.years = years;
	}

	public ITuitionReportService getTuitionReportService() {
		return tuitionReportService;
	}

	public void setTuitionReportService(ITuitionReportService tuitionReportService) {
		this.tuitionReportService = tuitionReportService;
	}

	public InputStream getExcelStream() {
		return excelStream;
	}

	public void setExcelStream(InputStream excelStream) {
		this.excelStream = excelStream;
	}
	
}
